#ifndef FORMFAMILYEDITOR_H
#define FORMFAMILYEDITOR_H

#include <QWidget>
#include "formabstract.h"
#include <formpersonseditor.h>


namespace Ui {
    class FormFamilyEditor;
}

class FormFamilyEditor : public FormAbstract
{
    Q_OBJECT

    FormPersonsEditor   *mp_person_sel;
    QVariant    mqv_tperson_key;
    QVariant    mqv_mperson_key;
    SLEE_HDB_REC_LST mqh_members_lst;
    QVariantList    mqv_memb_keys_lst;
     void post_init_dbms();
     void clear_form();
     void data_to_form(const SLEE_HDB_REC &qh_data);
     SLEE_HDB_REC form_to_data();
    void load_members_list();
    void update_member_list_item();

public:
    explicit FormFamilyEditor(QWidget *parent = 0);
    ~FormFamilyEditor();

     QVariant get_current_key();
     SLEE_HDB_REC get_current_data();
     QString get_current_name();
     bool is_data_selected();
     void set_data(QVariant qv_key);
     void set_tenant_pers(const QVariant &qv_key);

private slots:

     void select_member(QVariant qv_key, QHash<int,QVariant> qh_data);

protected slots:

     void    select_current_data() ;

     void    add_data();
     void    update_data();
     void    remove_data();

     void    set_edit_mode(bool);

public slots:

     void clear_selection();

private:
    Ui::FormFamilyEditor *ui;
};

#endif // FORMFAMILYEDITOR_H
